$gwx_XC_16=function(_,_v,_n,_p,_s,_wp,_wl,$gwn,$gwl,$gwh,wh,$gstack,$gwrt,gra,grb,TestTest,wfor,_ca,_da,_r,_rz,_o,_oz,_1,_1z,_2,_2z,_m,_mz,nv_getDate,nv_getRegExp,nv_console,nv_parseInt,nv_parseFloat,nv_isNaN,nv_isFinite,nv_decodeURI,nv_decodeURIComponent,nv_encodeURI,nv_encodeURIComponent,$gdc,nv_JSON,_af,_gv,_ai,_grp,_gd,_gapi,$ixc,_ic,_w,_ev,_tsd){return function(path,global){
if(typeof global==='undefined'){if (typeof __GWX_GLOBAL__==='undefined')global={};else global=__GWX_GLOBAL__;}if(typeof __WXML_GLOBAL__ === 'undefined') {__WXML_GLOBAL__={};
}__WXML_GLOBAL__.modules = __WXML_GLOBAL__.modules || {};
var e_={}
if(typeof(global.entrys)==='undefined')global.entrys={};e_=global.entrys;
var d_={}
if(typeof(global.defines)==='undefined')global.defines={};d_=global.defines;
var f_={}
if(typeof(global.modules)==='undefined')global.modules={};f_=global.modules || {};
var p_={}
__WXML_GLOBAL__.ops_cached = __WXML_GLOBAL__.ops_cached || {}
__WXML_GLOBAL__.ops_set = __WXML_GLOBAL__.ops_set || {};
__WXML_GLOBAL__.ops_init = __WXML_GLOBAL__.ops_init || {};
var z=__WXML_GLOBAL__.ops_set.$gwx_XC_16 || [];
function gz$gwx_XC_16_1(){
if( __WXML_GLOBAL__.ops_cached.$gwx_XC_16_1)return __WXML_GLOBAL__.ops_cached.$gwx_XC_16_1
__WXML_GLOBAL__.ops_cached.$gwx_XC_16_1=[];
(function(z){var a=11;function Z(ops){z.push(ops)}
Z([1,true])
Z([[7],[3,'color']])
Z([[7],[3,'title']])
Z([[2,'!'],[[7],[3,'is_charged']]])
Z([3,'charging'])
Z([[7],[3,'is_charging']])
Z([[2,'&&'],[[2,'>'],[[7],[3,'times']],[1,0]],[[7],[3,'is_charging']]])
Z([[7],[3,'is_charged']])
})(__WXML_GLOBAL__.ops_cached.$gwx_XC_16_1);return __WXML_GLOBAL__.ops_cached.$gwx_XC_16_1
}
__WXML_GLOBAL__.ops_set.$gwx_XC_16=z;
__WXML_GLOBAL__.ops_init.$gwx_XC_16=true;
var x=['./pages/charging/charging.wxml'];d_[x[0]]={}
var m0=function(e,s,r,gg){
var z=gz$gwx_XC_16_1()
var xOC=_mz(z,'navigation-bar',['back',0,'color',1,'title',1],[],e,s,gg)
_(r,xOC)
var bMC=_v()
_(r,bMC)
if(_oz(z,3,e,s,gg)){bMC.wxVkey=1
var oPC=_n('view')
_rz(z,oPC,'class',4,e,s,gg)
var fQC=_v()
_(oPC,fQC)
if(_oz(z,5,e,s,gg)){fQC.wxVkey=1
}
var cRC=_v()
_(oPC,cRC)
if(_oz(z,6,e,s,gg)){cRC.wxVkey=1
}
fQC.wxXCkey=1
cRC.wxXCkey=1
_(bMC,oPC)
}
var oNC=_v()
_(r,oNC)
if(_oz(z,7,e,s,gg)){oNC.wxVkey=1
}
bMC.wxXCkey=1
oNC.wxXCkey=1
return r
}
e_[x[0]]=e_[x[0]]||{f:m0,j:[],i:[],ti:[],ic:[]}
if(path&&e_[path]){
return function(env,dd,global){$gwxc=0;var root={"tag":"wx-page"};root.children=[]
;g="$gwx_XC_16";var main=e_[path].f
if (typeof global==="undefined")global={};global.f=$gdc(f_[path],"",1);
try{
main(env,{},root,global);
_tsd(root)
}catch(err){
console.log(err)
}
;g="";
return root;
}
}
}
}(__g.a,__g.b,__g.c,__g.d,__g.e,__g.f,__g.g,__g.h,__g.i,__g.j,__g.k,__g.l,__g.m,__g.n,__g.o,__g.p,__g.q,__g.r,__g.s,__g.t,__g.u,__g.v,__g.w,__g.x,__g.y,__g.z,__g.A,__g.B,__g.C,__g.D,__g.E,__g.F,__g.G,__g.H,__g.I,__g.J,__g.K,__g.L,__g.M,__g.N,__g.O,__g.P,__g.Q,__g.R,__g.S,__g.T,__g.U,__g.V,__g.W,__g.X,__g.Y,__g.Z,__g.aa);if(__vd_version_info__.delayedGwx||false)$gwx_XC_16();	if (__vd_version_info__.delayedGwx) __wxAppCode__['pages/charging/charging.wxml'] = [$gwx_XC_16, './pages/charging/charging.wxml'];else __wxAppCode__['pages/charging/charging.wxml'] = $gwx_XC_16( './pages/charging/charging.wxml' );
	;__wxRoute = "pages/charging/charging";__wxRouteBegin = true;__wxAppCurrentFile__="pages/charging/charging.js";define("pages/charging/charging.js",function(require,module,exports,window,document,frames,self,location,navigator,localStorage,history,Caches,screen,alert,confirm,prompt,XMLHttpRequest,WebSocket,Reporter,webkit,WeixinJSCore){
"use strict";var e=getApp(),t="",a="";Page({data:{title:"充电",color:"#FFFFFF",times:0,time_show:"",level:"",is_charging:!1,is_charged:!1,device_id:""},onLoad:function(e){this.setData({device_id:e.device_id})},onReady:function(){},onShow:function(){var e=this;e.getOrderInfo(),e.getCharging(),a=setInterval((function(){e.getCharging()}),3e3)},onHide:function(){clearInterval(t),clearInterval(a)},onUnload:function(){clearInterval(t),clearInterval(a)},onPullDownRefresh:function(){},onReachBottom:function(){},getOrderInfo:function(){var a=this,n=a.data.device_id,i=-1;e.ajax({url:"User/Order/changeDuration",data:{device_id:n},success:function(e){if(1e3==e.data.code){var n=new Date,r=parseInt(n.getTime()/1e3),o=e.data.data;i=parseInt(o)-parseInt(r),a.setData({times:i}),a.setTimer()}else a.setData({times:i}),clearInterval(t)}})},time2string:function(e){var t=Math.floor(e/86400);e%=86400;var a=Math.floor(e/3600);e%=3600;var n=Math.floor(e/60),i="";return t>0&&(i=t+"天"),a>0&&(i+=a+"时"),n>0&&(i+=n+"分"),i+=(e%=60)>0?e+"秒":"0秒"},getCharging:function(){var e=this;wx.getBatteryInfo({success:function(t){e.setData({is_charging:t.isCharging,level:parseInt(t.level)})}})},setTimer:function(){var e=this;clearInterval(t),t=setInterval((function(){var a=e.data.times;if(a<=0)clearInterval(t),setTimeout((function(){e.setData({is_charged:!0})}),1e3);else{a--;var n=e.time2string(a);e.setData({times:a,time_show:n})}}),1e3)},goPayCharge:function(){wx.navigateBack({delta:1})},goHome:function(){wx.setStorageSync("canLoad",!0),wx.redirectTo({url:"../home/home"})}});
},{isPage:true,isComponent:true,currentFile:'pages/charging/charging.js'});require("pages/charging/charging.js");